#ifndef __MYRPCAPPLICATION_H__
#define __MYRPCAPPLICATION_H__

#include "myrpcconf.h"
#include <mutex>

// 基础类(设计为单例类)，负责rpc框架的初始化工作
class MyRPCApplication
{
public:
    static void init(int argc, char **argv);
    // 获取该类对象的引用
    static MyRPCApplication& getInstance();
    // 删除该类对象
    static void deleteInstance();
    // 获取配置文件类对象引用
    static MyRPCConfig& getConfig();
private:
    MyRPCApplication(){}
    ~MyRPCApplication(){}
    // 删除拷贝构造
    MyRPCApplication(const MyRPCApplication&) = delete;
    // 删除移动构造
    MyRPCApplication(MyRPCApplication&&) = delete;
private:
    static MyRPCConfig m_config;
    static MyRPCApplication* m_application;
    static std::mutex m_mutex;
};


#endif